package com.yuanlrc.base.bean;
/**
 * 错误码统一处理类，所有的错误码统一定义在这里
 *
 */
public class CodeMsg {


	private int code;//错误码

	private String msg;//错误信息

	/**
	 * 构造函数私有化即单例模式
	 * @param code
	 * @param msg
	 */
	private CodeMsg(int code,String msg){
		this.code = code;
		this.msg = msg;
	}

	public int getCode() {
		return code;
	}



	public void setCode(int code) {
		this.code = code;
	}



	public String getMsg() {
		return msg;
	}



	public void setMsg(String msg) {
		this.msg = msg;
	}

	//通用错误码定义
	//处理成功消息码
	public static CodeMsg SUCCESS = new CodeMsg(0, "success");
	//非法数据错误码
	public static CodeMsg DATA_ERROR = new CodeMsg(-1, "非法数据！");
	public static CodeMsg CPACHA_EMPTY = new CodeMsg(-2, "验证码不能为空！");
	public static CodeMsg VALIDATE_ENTITY_ERROR = new CodeMsg(-3, "");
	public static CodeMsg SESSION_EXPIRED = new CodeMsg(-4, "会话已失效，请刷新页面重试！");
	public static CodeMsg CPACHA_ERROR = new CodeMsg(-5, "验证码错误！");
	public static CodeMsg USER_SESSION_EXPIRED = new CodeMsg(-6, "还未登录或会话失效，请重新登录！");
	public static CodeMsg UPLOAD_PHOTO_SUFFIX_ERROR = new CodeMsg(-7, "图片格式不正确！");
	public static CodeMsg UPLOAD_PHOTO_ERROR = new CodeMsg(-8, "图片上传错误！");
	public static CodeMsg RADIO_ERROR = new CodeMsg(-9, "请选择登陆类型！");
	public static CodeMsg ORDER_SN_ERROR = new CodeMsg(-12, "订单编号错误！");
	public static CodeMsg PHONE_ERROR = new CodeMsg(-13, "手机号错误！");
	public static CodeMsg ORDER_AUTH_ERROR = new CodeMsg(-14, "\u8ba2\u5355\u9a8c\u8bc1\u5931\u8d25\uff0c\u8ba2\u5355\u7f16\u53f7\u6216\u624b\u673a\u53f7\u8f93\u5165\u6709\u8bef\u6216\u8005\u53ef\u80fd\u4f60\u8d2d\u4e70\u7684\u662f\u76d7\u7248\uff0c\u8bf7\u8054\u7cfb\u3010\u733f\u6765\u5165\u6b64\u3011\u5ba2\u670d\uff01");

	//后台管理类错误码
	//用户管理类错误
	public static CodeMsg ADMIN_USERNAME_EMPTY = new CodeMsg(-2000, "用户名不能为空！");
	public static CodeMsg ADMIN_PASSWORD_EMPTY = new CodeMsg(-2001, "密码不能为空！");
	public static CodeMsg ADMIN_NO_RIGHT = new CodeMsg(-2002, "您所属的角色没有该权限！");

	//登录类错误码
	public static CodeMsg ADMIN_USERNAME_NO_EXIST = new CodeMsg(-3000, "该用户名不存在！");
	public static CodeMsg ADMIN_PASSWORD_ERROR = new CodeMsg(-3001, "密码错误！");
	public static CodeMsg ADMIN_USER_UNABLE = new CodeMsg(-3002, "该用户已被冻结，请联系管理员！");
	public static CodeMsg ADMIN_USER_ROLE_UNABLE = new CodeMsg(-3003, "该用户所属角色状态不可用，请联系管理员！");
	public static CodeMsg ADMIN_USER_ROLE_AUTHORITES_EMPTY = new CodeMsg(-3004, "该用户所属角色无可用权限，请联系管理员！");

	//后台菜单管理类错误码
	public static CodeMsg ADMIN_MENU_ADD_ERROR = new CodeMsg(-4000, "菜单添加失败，请联系管理员！");
	public static CodeMsg ADMIN_MENU_EDIT_ERROR = new CodeMsg(-4001, "菜单编辑失败，请联系管理员！");
	public static CodeMsg ADMIN_MENU_ID_EMPTY = new CodeMsg(-4002, "菜单ID不能为空！");
	public static CodeMsg ADMIN_MENU_ID_ERROR = new CodeMsg(-4003, "菜单ID错误！");
	public static CodeMsg ADMIN_MENU_DELETE_ERROR = new CodeMsg(-4004, "改菜单下有子菜单，不允许删除！");
	//后台角色管理类错误码
	public static CodeMsg ADMIN_ROLE_ADD_ERROR = new CodeMsg(-5000, "角色添加失败，请联系管理员！");
	public static CodeMsg ADMIN_ROLE_NO_EXIST = new CodeMsg(-5001, "该角色不存在！");
	public static CodeMsg ADMIN_ROLE_EDIT_ERROR = new CodeMsg(-5002, "角色编辑失败，请联系管理员！");
	public static CodeMsg ADMIN_ROLE_DELETE_ERROR = new CodeMsg(-5003, "该角色下存在用户信息，不可删除！");
	//后台用户管理类错误码
	public static CodeMsg ADMIN_USER_ROLE_EMPTY = new CodeMsg(-6000, "请选择用户所属角色！");
	public static CodeMsg ADMIN_USERNAME_EXIST = new CodeMsg(-6001, "该用户名已存在，请换一个试试！");
	public static CodeMsg ADMIN_USE_ADD_ERROR = new CodeMsg(-6002, "用户添加失败，请联系管理员！");
	public static CodeMsg ADMIN_USE_NO_EXIST = new CodeMsg(-6003, "用户不存在！");
	public static CodeMsg ADMIN_USE_EDIT_ERROR = new CodeMsg(-6004, "用户编辑失败，请联系管理员！");
	public static CodeMsg ADMIN_USE_DELETE_ERROR = new CodeMsg(-6005, "该用户存在关联数据，不允许删除！");

	//后台学院列表类错误码 Faculties
	public static CodeMsg ADMIN_FACULTIESNAME_EXIST = new CodeMsg(-12001, "该学院名已存在，请换一个试试！");
	public static CodeMsg ADMIN_FACULTIESNUM_EXIST = new CodeMsg(-12006, "该学院编号已存在，请换一个试试！");
	public static CodeMsg ADMIN_FACULTIES_ADD_ERROR = new CodeMsg(-12002, "学院添加失败，请联系管理员！");
	public static CodeMsg ADMIN_FACULTIES_NO_EXIST = new CodeMsg(-12003, "学院不存在！");
	public static CodeMsg ADMIN_FACULTIES_EDIT_ERROR = new CodeMsg(-12004, "学院编辑失败，请联系管理员！");
	public static CodeMsg ADMIN_FACULTIES_DELETE_ERROR = new CodeMsg(-12005, "该学院存在关联数据，不允许删除！");

	//后台班级管理类错误码
	public static CodeMsg ADMIN_CLAZZ_FACULTIES_EMPTY = new CodeMsg(-11000, "请选择班级所属学院！");
	public static CodeMsg ADMIN_CLAZZNAME_EXIST = new CodeMsg(-11001, "该班级名已存在，请换一个试试！");
	public static CodeMsg ADMIN_CLAZZ_ADD_ERROR = new CodeMsg(-11002, "班级添加失败，请联系管理员！");
	public static CodeMsg ADMIN_CLAZZ_NO_EXIST = new CodeMsg(-11003, "班级不存在！");
	public static CodeMsg ADMIN_CLAZZ_EDIT_ERROR = new CodeMsg(-11004, "班级编辑失败，请联系管理员！");
	public static CodeMsg ADMIN_CLAZZ_DELETE_ERROR = new CodeMsg(-11005, "该班级存在关联数据，不允许删除！");
	public static CodeMsg ADMIN_CLAZZNUM_EXIST = new CodeMsg(-11006, "该班级编号已存在，请换一个试试！");

	//后台用户修改密码类错误码
	public static CodeMsg ADMIN_USER_UPDATE_PWD_ERROR = new CodeMsg(-7000, "旧密码错误！");
	public static CodeMsg ADMIN_USER_UPDATE_PWD_EMPTY = new CodeMsg(-7001, "新密码不能为空！");

	//后台用户修改密码类错误码
//	public static CodeMsg ADMIN_DATABASE_BACKUP_NO_EXIST = new CodeMsg(-8000, "备份记录不存在！");


	//后台学生管理类错误码
	public static CodeMsg ADMIN_STUDENT_FACULTIES_EMPTY = new CodeMsg(-90000, "请选择所属学院！");
	public static CodeMsg ADMIN_STUDENT_CLAZZ_EMPTY = new CodeMsg(-90001, "请选择所属班级！");
	public static CodeMsg ADMIN_STUDENTID_EXIST = new CodeMsg(-90002, "学号已存在！");
	public static CodeMsg ADMIN_STUDENT_NO_EXIST = new CodeMsg(-90003, "学号不存在！");
	public static CodeMsg ADMIN_STUDENT_ROLE_EMPTY = new CodeMsg(-90004, "请设置权限！");
	public static CodeMsg ADMIN_STUDENT_ROLE_AUTHORITES_EMPTY = new CodeMsg(-90004, "该学生所属角色无可用权限，请联系管理员！");



	//后台归还图书类错误码
	public static CodeMsg ADMIN_BOOK_RETURN_ERROR = new CodeMsg(-8000, "该图书已归还或已逾期！");
	public static final CodeMsg VIOLATION_DELETE_ERROR = new CodeMsg(-8001,"该记录无法删除");


	//后台书屋管理类错误码
	public static CodeMsg ADMIN_LIBRARY_EXIST = new CodeMsg(-100001, "该书屋名已存在，请换一个试试！");
	public static CodeMsg ADMIN_LIBRARY_ADD_ERROR = new CodeMsg(-100002, "书屋添加失败，请联系管理员！");
	public static CodeMsg ADMIN_LIBRARY_NO_EXIST = new CodeMsg(-100003, "书屋不存在！");
	public static CodeMsg ADMIN_LIBRARY_EDIT_ERROR = new CodeMsg(-100004, "书屋编辑失败，请联系管理员！");
	public static CodeMsg ADMIN_LIBRARY_DELETE_ERROR = new CodeMsg(-100005, "该书屋存在关联数据，不允许删除！");

	//分类信息添加错误
	public static CodeMsg ADMIN_BOOK_CATEGORY_ERROR = new CodeMsg(-9000, "请选择图书一级和二级分类");
	public static final CodeMsg ADMIN_EDIT_BOOK_CATEGORY_ERROR = new CodeMsg(-9001,"二级分类无法修改成一级分类编辑，请联系管理员！");

	public static final CodeMsg ADMIN_BORROW_ADD_ERROR = new CodeMsg(-9101, "借阅失败!");
	public static CodeMsg ADMIN_BORROW_ADD_NUM_ERROR = new CodeMsg(-9102, "数量不可为负数!");
	public static CodeMsg ADMIN_BORROW_DATE_ADD_ERROR = new CodeMsg(-9103,"还书日期不能小于当前时间");
	public static CodeMsg ADMIN_CATEGORY_ADD_ERROR = new CodeMsg(-9104,"类型添加失败");
	public static CodeMsg ADMIN_CATEGORY_UPDATE_ERROR = new CodeMsg(-9105,"类型更新失败");
	public static  CodeMsg  ADMIN_BOOK_ADD_ERROR=new CodeMsg(-9106,"图书添加失败,请联系管理员!");
	public static  CodeMsg  ADMIN_BOOK_EDIT_ERROR=new CodeMsg(-9108,"图书编辑失败,请联系管理员!");
	public static  CodeMsg  ADMIN_BOOK_DELETE_ERROR=new CodeMsg(-9109,"图书删除失败,该图书下有关联数据!");
	public static  CodeMsg  ADMIN_BOOK_NAME_EXIST_ERROR=new CodeMsg(-9107,"图书名称已存在,请更换一个!");

	public static CodeMsg ADMIN_BOOK_BORROW_DATETIME_ERROR=new CodeMsg(-9108,"归还时间不能小于当天时间");

	public static  CodeMsg ADMIN_BOOK_EXIST_ERROR=new CodeMsg(-9109,"图书不存在,请联系管理员!");

	public static CodeMsg ADMIN_BOOK_BORROW_ERROR=new CodeMsg(-9110,"借阅数据有误");
	public static  CodeMsg ADMIN_BOOK_STATUS_ERROR=new CodeMsg(-9111,"图书当前状态不可借阅!");

	public static  CodeMsg ADMIN_BOOK_BORROW_NUMBER_ERROR=new CodeMsg(-9112,"借阅图书数量超出该图书可借数量!");


}
